//
//  PhoneLabelView.swift
//  E-CycleForShop
//
//  Created by enghou on 17/3/10.
//  Copyright © 2017年 xyxorigation. All rights reserved.
//

import UIKit

class PhoneLabelView: UIView {

    
    private var label : UILabel?
    init(lbl : String,frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = UIColor.colorWithHexString(hex: "f9f9f9")
        let image = UIImageView.init(frame: CGRect.init(origin: CGPoint.init(x: 28 * YXWidthScale, y: 16 * YXHeightScale), size: CGSize.init(width: 160 * YXWidthScale, height: 160 * YXHeightScale)))
        image.image = UIImage.load(name: "pic_iphone")
        self.addSubview(image)
        
        label = UILabel.init(frame: CGRect.init(origin: CGPoint.init(x: 216 * YXWidthScale, y: image.top()), size: CGSize.init(width: frame.size.width - 216 * YXWidthScale, height: image.height())))
        label!.textColor = UIColor.black
        label!.textAlignment = .left
        label!.font = UIFont.boldSystemFont(ofSize: 30 * YXWidthScale)
        label!.text = lbl
        self.addSubview(label!)
    }
    
    func feed(content : String) -> Void {
        label!.text = content
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */

}
